#ifndef _TaskManager
#define _TaskManager

#include "ParamManager.h"
#include <time.h>
#include "Task.h"


class TaskManager {
public:
	Task *head, *curr;
	HANDLE mutex;

	// Constructor
	TaskManager();

	// Deconstructor
	~TaskManager();

	// dete all saved tasks
	void clear();

	// add a new task
	Task* add(char* /*id*/, State /*state*/);

	// get a task by the specified id
	Task* get(char* /*id*/);

	// del a task by the specified id
	bool del(char* /*id*/);

	// set a task detail
	bool set(char* /*id*/, char* /*data*/, char* /*value*/);


	// reset current pointer back to head node, and return
	Task* reset();
	// return current pointer and advance forward
	Task* getNext();
	// return current pointer and advance backward
	Task* getPrev();


	// debug
	void dump();
};

#endif // _TaskManager